﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.OracleClient;
using System.Data;

namespace BLL.ElecBoss
{
    public class DutyZbrj
    {
        OracleDAL.ElecBoss.DutyZbrj duty = new OracleDAL.ElecBoss.DutyZbrj();
        public DataSet getDutyInfo(string userisn, string nodeid)
        {
            DataSet ds = new DataSet();
            ds = duty.getDutyInfo(userisn, nodeid);
            return ds;
        }
        /// <summary>
        /// 获取用户是否是在线用户
        /// </summary>
        /// <param name="userisn">用户ID</param>
        /// <returns></returns>
        public bool IsUserOnline(string userisn)
        {
            DataSet ds = duty.IsUserOnline(userisn);
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        public DataSet getDutyCount()
        {
            return duty.getDutyCount();
        }
        public DataSet getDutySum()
        {
            return duty.getDutySum();

        }
        public DataSet getDutyFromDutyID(string dutyID)
        {
            DataSet ds = new DataSet();
            ds = duty.getDutyFromDutyID(dutyID);
            return ds;

        }
        public int addDuty(string id, string field, string value, string nodeid, string userisn)
        {
            int result = duty.addDuty(id, field, value, nodeid, userisn);
            return result;
        }
        public int editDuty(string id, string field, string value)
        {
            int result = duty.editDuty(id, field, value);
            return result;
        }
        public DataSet nextAndLastDuty(string type, string date)
        {
            DataSet ds = new DataSet();
            ds = duty.nextAndLastDuty(type, date);
            return ds;
        }
        public DataSet nextAndLastDutydetail(string type, string date)
        {
            DataSet ds = new DataSet();
            ds = duty.nextAndLastDutydetail(type, date);
            return ds;
        }
        public DataSet impStr()
        {

            return duty.impStr();
        }
        public DataSet getThingInfo()
        {
            return duty.getThingInfo();
        }
        /// <summary>
        /// 删除值班员 出现故障过长时间将删除
        /// </summary>
        /// <returns></returns>
        public int delLedayDuty()
        {
            return duty.delLedayDuty();
        }

        /// <summary>
        /// 执行sql语句
        /// </summary>
        /// <returns></returns>
        public int ExcuteSql(string strSql)
        {
            return duty.ExcuteSql(strSql);
        }

    }
}
